package com.example.demo.serializer;

import com.alibaba.fastjson.JSON;
import com.example.demo.entity.UserLogInfo;
import org.apache.kafka.common.errors.SerializationException;
import org.apache.kafka.common.header.Headers;
import org.apache.kafka.common.serialization.Serializer;

import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.Map;

/**
 * UserLogInfo类序列化器
 */
public class UserLogSerializer implements Serializer<UserLogInfo> {


    @Override
    public void configure(Map<String, ?> configs, boolean isKey) {

    }

    @Override
    public byte[] serialize(String s, UserLogInfo data) {
        return JSON.toJSONBytes(data);
    }



    @Override
    public void close() {

    }
}
